<!DOCTYPE html>
<html>
<head>
    <title>修改配置</title>
    $css()

    <style>
        .box {
            margin-top:10px;width:380px;padding:12px;border:solid 1px #ff6600;background: #FFE;
        }
    </style>
</head>
<body>
    <div class="form form2" id="form1" style="padding:20px">

        <div class="fl">
            <div class="box">网站某些操作需要清理缓存或重启后，才能生效！</div>
        </div>

        <div class="fl">
                    
                    <span class="ui-button w100">
                        <span class="button-inner">
                            <span class="button-txt">重启网站</span>
                            <input type="button" onclick="clearFor('reboot')" />
                        </span>
                    </span>
                    &nbsp;
                    <span class="ui-button w100">
                        <span class="button-inner">
                            <span class="button-txt">清理缓存</span>
                            <input type="button" onclick="clearFor('cache')" />
                        </span>
                    </span>


            </div>
        

        <div class="btnarea" style="padding-left:58px;padding-top:25px;">
            
        </div>
    </div>

    $js()
    <script type="text/javascript">
        function clearFor(f) {
            var t = this;
            t.disabled = true;
            jr.xhr.filter = null;
            jr.xhr.jsonPost(location.href, { 'for': f, "xhr": 1 }, function (json) {
                if (json.result) {
                    if (f == "reboot") {
                        showMsg2(json.message, null, 20000);
                        jr.xhr.get(location.href, function () {
                            showMsg2('网站已重启');
                            t.disabled = false;
                        }, function (x) {
                            t.disabled = false;
                            showMsg2(x);
                        });
                    } else {
                        showMsg2(json.message);
                        t.disabled = false;
                    }
                } else {
                    showErr(json.message, 2000);
                    t.disabled = false;
                }
            }, function () {
                showErr("操作失败", 1000);
            });
        }
    </script>

</body>
</html>
